func subarraySum(nums []int, k int) (result int) {
	pre := 0
	mp := map[int]int{}
	mp[0] = 1
	for _, v := range nums {
		pre += v
		if _, has := mp[pre-k]; has {
			result += mp[pre-k]
		}
		mp[pre] += 1
	}
	return
}